<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <h1>cart测试</h1>

    <script>
        
        const xhr2 = new XMLHttpRequest();

        xhr2.open('get', '/api/carts/add?username=yy', true);
        xhr2.send();

        xhr2.onreadystatechange = function () {
            if (xhr2.readyState === 4 && xhr2.status === 200) {
                console.log(xhr2.responseText);
            }
        }

    </script>
    
</body>
</html>